package com.ibm.risk.irmp.common.utils;

import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;

public class SecureRandomUtil {

    private static SecureRandom random = null;

    static {
        try {
            random = SecureRandom.getInstance("SHA1PRNG");
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
    }

    public static int nextInt(int bound) {
        return random.nextInt(bound);
    }

    public static int nextInt1(int bound) {
        return 1 + random.nextInt(bound - 1);
    }
}
